package com.wandian.demo.ui
{
	import com.wandian.demo.controller.LinesController;
	
	import flash.display.Bitmap;
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	
	import utils.Res;
	import utils.UIHelper;

	public class LinesContainer extends Sprite
	{		
		//public var lines:Array=[];
		public function LinesContainer()
		{
			super();
			this.x=LinesController.Instance.startX;
			for (var i:int=0; i < LinesController.Instance.allLinesArray.length; i++)
			{
			var bitmap:Bitmap=new Bitmap(Res.get("line" + LinesController.Instance.allLinesArray[i]));	
			bitmap.visible=false;
			bitmap.scaleY=306/ 312;
//			var childSprite:LinesDisplayObject=new LinesDisplayObject("line" + LinesController.Instance.allLinesArray[i]);	
//			childSprite.visible=false;
			this.addChild(bitmap);
				//UIHelper.addSpriteChild(this, new LinesDisplayObject("line" + LinesController.Instance.allLinesArray[i]), null, LinesController.Instance.allLinesX[i], LinesController.Instance.allLinesY[i], false, false);
			}

		    this.scaleY=270/312;
			this.y=LinesController.Instance.startCenterY - this.height / 2;
	
//		UIHelper.addRectSpriteChild(this,null,null,0,0,this.width,this.height,0x7CFC00,0.2);
		/*
		for (var j:int = 0; j < this.numChildren; j++)
		{
			var display:DisplayObject= this.getChildAt(j);
			trace("LinesContainer.LinesContainer():child "+display.name+" x "+display.x+" y "+display.y+" height "+display.height+" width "+display.width);
		}
		trace("LinesContainer.LinesContainer():parent  x "+this.x+" y "+this.y+" height "+this.height+" width "+this.width);*/
		}

		public function addLines(num:int, boolShow:Boolean=true):void
		{
			UIHelper.addSpriteChild(this, new LinesDisplayObject("line" + num), null, 0, 0, false, boolShow);
		}
	}
}
